﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Traceability.Infaseture.Migrations
{
    public partial class _3 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "GoodsName",
                table: "account",
                newName: "PassWord");

            migrationBuilder.RenameColumn(
                name: "SId",
                table: "account",
                newName: "Id");

            migrationBuilder.AddColumn<string>(
                name: "AccountName",
                table: "account",
                type: "nvarchar(max)",
                nullable: false,
                defaultValue: "");

            migrationBuilder.CreateTable(
                name: "goods",
                columns: table => new
                {
                    SId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    GoodsName = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_goods", x => x.SId);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "goods");

            migrationBuilder.DropColumn(
                name: "AccountName",
                table: "account");

            migrationBuilder.RenameColumn(
                name: "PassWord",
                table: "account",
                newName: "GoodsName");

            migrationBuilder.RenameColumn(
                name: "Id",
                table: "account",
                newName: "SId");
        }
    }
}
